package com.it.test;

import com.it.service.AccountService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TEST_spring {

    @Test
    public void run1() {
        //获取spring容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");

        //从容器中通过ID获取bean对象
        AccountService as = (AccountService) ac.getBean("accountService");

        //使用接口调用方式
        as.findAll();
    }

}
